package com.AJava1710D.设计模式.单例.枚举单例;

import java.io.*;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

/**
 * 作者: LCG
 * 日期: 2020/6/29 09:55
 * 描述:
 */
public class TestMeiJu {

    public static void main(String[] args) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, IOException, ClassNotFoundException {

        MeiJu instance = MeiJu.INSTANCE.getInstance();

        Constructor<MeiJu> constructor = MeiJu.class.getDeclaredConstructor();

        constructor.setAccessible(true);

        MeiJu MeiJu = constructor.newInstance();


        System.out.println("---->"+(MeiJu==instance));


       /* ByteArrayOutputStream byteArrayOutputStream=new ByteArrayOutputStream();
        ObjectOutputStream objectOutputStream=new ObjectOutputStream(byteArrayOutputStream);

        objectOutputStream.writeObject(instance);

        ByteArrayInputStream byteArrayInputStrea=new ByteArrayInputStream(byteArrayOutputStream.toByteArray());
        ObjectInputStream objectInputStream=new ObjectInputStream(byteArrayInputStrea);

        Object object = objectInputStream.readObject();


        System.out.println(object==instance);*/

    }

}
